package com.imxplus.example01

import akka.actor.{ActorSystem, Props}
import com.imxplus.example01.Messages.{BoilWater, TurnOnLight}

import scala.io.StdIn

object Demo02 extends App {
  val actorSystem = ActorSystem("robot-system")
  println(s"The ActorSystem logLevel is ${actorSystem.settings.LogLevel}")
  val robotActor = actorSystem.actorOf(Props(new RobotActor), "robotActor")

  robotActor ! TurnOnLight(1)
  robotActor ! BoilWater(2)

  robotActor ! "who are u"

  println("Press <Enter> to quit.")
  StdIn.readLine()
  actorSystem.terminate()
}
